home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
HPAVC
/
HPAVC CD-ROM.iso
/
ELYVER10.ZIP
/
ELYSIUM.TXT
next >
Wrap
Text File
|
1997-01-25
|
15KB
|
283 lines
oOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoO
+ELYSiUM's IBM PC MS-DOS VGA Graphics & Sound Blaster Programming Reference
List for the C++ and Assembly Languages
+Maintainer : ELYSiUM who can be contacted via e-mail at ELYSiUM@Bigfoot.com
+Version : 1.0
+Date : January 23, 1997 A.D.
+Notes : This file is best viewed using MS-DOS Editor
oOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoO
=Introduction
Welcome. This file is a list of resources that I have found to be the best
ways to learn how to do IBM PC MS-DOS VGA graphics & Sound Blaster
programming in the C++ and Assembly Languages. In order to be able to
successfully learn, you must have the following knowledge:
- You know the basics of a computer. How most computer parts work, what
RAM, VGA, BIOS, and other computer components are, what they do, and
how they work.
- You own an IBM PC(or 100% compatible) computer that is running MS-DOS
and a C++ development environment. [Note: The specific books, or
electronic documents, will tell you what the author used for the source
code that was included.]
- You know how to thoroughly operate an IBM PC(or 100% compatible) computer
running MS-DOS.
-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/
=Step 1: Can You Hack it?
So, you would like to make powerful graphics and sound programs? I'm
assuming you are already a computer "power-user," because you have the guts
to take up programming as your new hobby/career. I also am assuming you
don't have any programming knowledge at all, but that you know a lot about
the MS-DOS computer you are running. If you don't know a lot about computers,
you should not be reading this document for you are not experienced enough
to being programming. If you don't know the answers to every one of these
questions, you should not be reading this document.
1.) What is MS-DOS, what company makes it, and what does it do?
2.) What is a program, and how do you start a program?
3.) Explain what the following are: Hard Drive, RAM, BIOS, VGA, ISA, PCI,
Sound Blaster, pixel, hexadecimal, software, hardware, MHz, CPU, 486,
Pentium, Pentium Pro, MMX, Bill Gates, Microsoft, 8086, Intel,
resolution, bit, byte, kilobyte, megabyte, gigabyte, terabyte, drive
bay, CD-ROM, disk/diskette, DOS Editor, defrag, virus, interrupt, DMA,
Internet, modem, serial port, PS/2 port, and Windows Control Panel.
4.) Explain what the following MS-DOS commands do: CD, MD, RD, DEL, ERASE,
DELTREE, COPY, and MOVE.
5.) What would the numbers 320x200 or 640x480 usually refer to?
6.) What type of files would the following file extensions refer to: TXT,
ZIP, INI, SYS, BAT, ARJ, LZH, COM, EXE, DIZ, DRV, HTM, GIF, PCX, JPG,
BMP, AVI, MPG, WAV, VOC, MOD, and ICO.
7.) How do you cut and paste text from one place to another?
8.) What is DOOM?
9.) What do the files AUTOEXEC.BAT and CONFIG.SYS do?
10.) What does HIMEM.SYS and PROMPT $P$G do?
11.) What is a programmer?
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
=Step 2: What type of programming will we be doing?
Programming is also know as "coding." This is because the text that a
programmer writes to make a program is known as the "source code," or just
the "code." So the two words programmer and coder are interchangable, as well
as programming and coding. Anyways, I'm assuming you have absolutely no
knowledge whatsoever of programming. I personally, as well as many others,
believe that the C++ programming language is the best all-around language. I
also believe that Assembly language is _very_ important to obtain more
control of the computer and to also create faster programs. The reason why
Assembly language is so fast is because it is a "low-level language." This
means that it is very close to the computer hardware, whereas languages like
C++ are farther away from the hardware. However, there is a trade-off for the
speed of Assembly language, and that trade-off is that it is one of the
hardest languages to learn because it is so cryptic. For example, these two
examples of code do the same exact thing but one is in C++, and the other is
in Assembly. [Note: From now on, this document will use "ASM" in place of the
word "Assembly."]
[C++]
cout << "Hello, World!";
[ASM]
Message db 'Hello, World.$'
mov ax,seg Message
mov ds,ax
mov dx,offset Message
mov ah,9
int 21h
Now, both of these lines do the same exact thing, they print out on the
monitor the following words: "Hello, World!". Which you may have been able
to tell, is that the ASM version is _much_ longer than the C++ version. Now
you can visually see the trade-off of speed for ease of programming.
C++ is a fast language, faster than others like BASIC, but for graphics
programming, it is not always fast enough. However, ASM is as fast as you
need. Most people do not like to write entire programs in ASM because it is
so complex, C++ on the other hand is not so complex, but is the next most
powerful language. So, we have a problem: How can we create a fast graphics
program that is not too complex to write? The answer is actually quite
simple. All you must do is take advantage of what is called, "Inline
Assembly"(or Inline ASM). The name describes what it is and does. Inline ASM
allows you to place ASM source code in the middle of your C++ programs! This
way you can write your main program in C++, which will keep it easy to
follow and modify, but your graphics will be very fast because your program's
special "functions" that do things like plot a pixel on the screen will be
made out of ASM!
Now that you know what two languages you will be dealing with, how they work,
and what their advantages and disadvantages are, we can proceed to the next
step...
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
=Step 3: How to actually program/code.
Now you know what program's look like before they are turned into EXE or
COM files. Basically, just a bunch of text similar to the text you saw in
Step 2. But before you learn how to start programming graphics, sound, and
music. You have to learn the languages themselves: how they work, how to use
them, how to turn your "source code" into executable files, and etc. The
first language you are going to learn is C++. Not ASM, because the main
bulk of your programs will be made out of C++, and not ASM. The C++
language is not the easiest language to learn, but it is by far _not_
the hardest. The following is a wonderful book that will teach you the
principles of programming, the entire base C++ language, and by the end of
the book, you will be able to create your own complex text-based programs
easily. The book even includes a disk with a "lite" version of Borland's
Turbo C++ 3.0 development environment. It doesn't create executable(EXE)
files, it just runs them from the program itself. If you want the full
version of Borland Turbo C++ 3.0 instead of the included "lite" version, you
can buy it from your local computer store or direct from borland for a price
range of $70-$100 USA. The book itself can also be found at your local
computer store, book store, and direct from Sams Publishing. (Note: The
disk with the lite version of Turbo C++ also includes all source code from
the book).
* C++ Programming in 12 Easy Lessons, Greg Perry, Sams Publishing, ISBN
0-672-30522-4 (with disk), $39.99 USA, 1-800-428-5331 USA
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
=Step 4: Done with basic C++, on with graphics!
Now that you have mastered the basics of C++ programming, let's do some
graphics programming! The next documents you are going to read are documents
authored by a "demo group" coder(Note: If you do not know what a "demo,"
and a "demo group" is, visit http://www.cdrom.com/pub/demos/ to learn about
demos. I am not reffering to game or software demo's). The author's name
is Grant Smith, best known as Denthor of the demo group "Asphyxia." He
had originally written the documents in Pascal(a programming language quite
similar to C++), but another demo group member named Christopher G. Mann,
best known as Snowman of the demo group named "Hornet." Anyways, the
documents are a series of tutorials teaching how to get into the VGA graphics
mode and how to do things like plot pixels to a screen, all the way up to
how to draw 3-D cubes and rotate them all around. The tutorials _do_ include
a tad bit of ASM code in them, but it is not too much and you will still be
able to learn how to create graphics programs without knowing ASM. The name
of the tutorial series is simply, "The VGA Trainer Program." I have included
the firs 10 lessons of the series. The following files should have been
inside of the ZIP file you got this text file from:
* TUT01NEW.ZIP - Lesson 1
* TUT02NEW.ZIP - Lesson 2
* TUT03NEW.ZIP - Lesson 3
* TUT04NEW.ZIP - Lesson 4
* TUT05NEW.ZIP - Lesson 5
* TUT06NEW.ZIP - Lesson 6
* TUT07NEW.ZIP - Lesson 7
* TUT08NEW.ZIP - Lesson 8
* TUT09NEW.ZIP - Lesson 9
* TUT10NEW.ZIP - Lesson 10
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
=Step 5: Assembly Language
As you can see, the only ASM code was in specific functions such as a
Putpixel function or a Line function. You probably figured out a little of
what the ASM code meant, but you need to know more. This is because if you
do not, you will not be able to develop your own custom ASM functions. The
following is an excellent web site that teaches you ASM programming for x86
computers. Read _everything_ on the web site. For example, if one of the
sections is, "Basic Computer Parts," still read it even if you think you
know everything about it. I say this because, for one, it will refresh your
memory. And two, it will go in more detail then you expect. For example, do
you know how many volts the CPU uses to turn one bit into an "off" or "on"
position? Anyways, follow all the example programs and pratice a lot. ASM
is probably the hardest language to learn. Also, once you have finished
learning the tutorial, return to the "VGA Trainer Program," look at the
source code files, and you will be amazed on how much more you will
understand. In fact, I reccomend you go through the entire VGA Trainer
Program, and you will learn a lot more.
* Assembly Language Tutorial:
http://udgftp.cencar.udg.mx/ingles/tutor/Assembler.html
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
=Step 6: Power Graphics Programming
Ever heard of a fellow named Michael Abrash? If you have not, he is a
programmer at "id Software." He is known for his graphics programming
brilliance and his brilliant graphics programming book. The book will teach
you everything from low-level VGA hardware programming, to fast animation
techniques, to 3-D algorithims, BSP trees, and even Quake! The book comes
with a CD-ROM which includes all sample programs from the book, and also
comes with a bonus. The bonus is a previous book that Michael Abrash wrote
named "Zen of Assembler." The book is in electronic form on the CD-ROM. The
book can be found at your local computer store, book store, or direct from
the Coriolis Group.
* Zen of Graphics Programming - 2nd Edition, Michael Abrash, Coriolis
Group, ISBN 0-672-30522-4 (with CD-ROM), $44.99 USA
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
=Step 7: Practice
By now, you have mastered a lot of things. I suggest that you practice
everything you have learned over and over again. It helps you think of new
ideas, algorithims, and allows you to optimize your code. Graphics
programming will soon be, if it now already is, second nature to you. Now
you are probably wanting to know how to incorporate music and sound into
your programs. That is next...
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
=Step 8: Sound and Music
If you read the title of this file, you may have noticed that I will focus
on programming for the Creative Labs Sound Blaster and 100% compatible
sound cards. I personally feel that the Advanced Gravis Ultrasound is
superior to the Sound Blaster, but unfortuanately, the Sound Blaster is a
sound card that can be found in just about _every_ computer sold today. So
I will focus on programming for the Sound Blaster only for compatibility's
sake.
The following files should be included in the ZIP file that you got this
text file from:
* MIKXMAS.ZIP - MikMod Version 2.10: A wonderful library to play many types
of sound and music files.
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
=Conclusion
If you ever have any troubles with any kind of programming. Do not be afraid
or embarrassed to seek help. You can search for helpful web sites or files
by using powerful search engines such as Alta Vista, which can be found at
http://www.altavista.com
Also, you can always e-mail the author's of documents like the VGA Trainer
Program. Usually, the authors will not mind helping one who is serious about
programming.
In conclusion, I would like to say that I hope this file will help many
people learn to program multimedia MS-DOS programs, whether it is a demo or
a new game. If you felt it helped you in any way, please tell me so by
dropping me a line or two at ELYSiUM@Bigfoot.com, and I would also like to
mention that this is not my only file to be released. I will release a
Version 2.0 of this file soon, or maybe Version 1.x, so keep watching for
a new one wherever you found this file. But don not expect a new file too
soon from the authored date of this one. Allow at least 3 months from the
authoring date of this file until the new one. It might even take more time.
Till next time, I'm ELYSiUM hoping I've helped all those who have wanted
to begin programming multimedia programs. And one more thing, this is my
first public release of anything, so please excuse any bugs and/or
misspllelings. Ciao... :-)
-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/